import requests
import time

# 等待服务启动
time.sleep(2)

try:
    response = requests.get("http://127.0.0.1:8000/api/orders/test-connection", timeout=5)
    print(f"状态码: {response.status_code}")
    print(f"响应: {response.text}")
except Exception as e:
    print(f"请求失败: {e}")
    
    # 尝试访问根路径
    try:
        response = requests.get("http://127.0.0.1:8000/", timeout=5)
        print(f"根路径状态码: {response.status_code}")
    except Exception as e2:
        print(f"根路径也无法访问: {e2}")
        print("服务器可能没有启动")
